package com.wc.AlgoOJ.MA0003;

/**
 * @Author congege
 * @Description 素数判定3
 * http://43.138.190.70:8888/p/MA0003
 * @Date Created in 2023/12/9-17:46
 */
public class Main {

    public static void main(String[] args) {

    }

    static boolean isPrime(long num) {
        if (num <= 3) {
            return num > 1;
        }
        if (num % 6 != 1 && num % 6 != 5) {
            return false;
        }
        int sq = (int) Math.sqrt(num);
        for (int i = 5; i <= sq; i += 6) {
            if (num % i == 0 || num % (i + 2) == 0)
                return false;
        }
        return true;
    }
}
